load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "clusterstate",
    srcs = [
        "current.go",
        "v2.0.0.go",
        "v2.1.0.go",
        "v2.10.0.go",
        "v2.11.0.go",
        "v2.12.0.go",
        "v2.3.0.go",
        "v2.5.0.go",
        "v2.5.4.go",
        "v2.6.0.go",
        "v2.7.0.go",
        "v2.8.0.go",
    ],
    importpath = "github.com/pachyderm/pachyderm/v2/src/internal/clusterstate",
    visibility = ["//src:__subpackages__"],
    deps = [
        "//src/enterprise",
        "//src/internal/authdb",
        "//src/internal/clusterstate/v2.10.0:v2_10_0",
        "//src/internal/clusterstate/v2.11.0:v2_11_0",
        "//src/internal/clusterstate/v2.12.0:v2_12_0",
        "//src/internal/clusterstate/v2.5.0:v2_5_0",
        "//src/internal/clusterstate/v2.6.0:v2_6_0",
        "//src/internal/clusterstate/v2.7.0:v2_7_0",
        "//src/internal/clusterstate/v2.8.0:v2_8_0",
        "//src/internal/collection",
        "//src/internal/errors",
        "//src/internal/migrations",
        "//src/internal/pachsql",
        "//src/internal/ppsdb",
        "//src/internal/storage/chunk",
        "//src/internal/storage/fileset",
        "//src/internal/storage/track",
        "//src/internal/transactiondb",
        "//src/pfs",
        "//src/server/auth",
        "//src/server/identity",
        "//src/server/license",
        "//src/server/license/server",
        "@io_etcd_go_etcd_client_v3//:client",
        "@org_golang_google_protobuf//proto",
    ],
)

go_test(
    name = "clusterstate_test",
    size = "small",
    srcs = [
        "v2.11.0_test.go",
        "v2.7.0_test.go",
        "v2.8.0_test.go",
    ],
    embed = [":clusterstate"],
    deps = [
        "//src/internal/clusterstate/v2.7.0:v2_7_0",
        "//src/internal/clusterstate/v2.8.0:v2_8_0",
        "//src/internal/clusterstate/v2.8.0/pfsdb_28x",
        "//src/internal/dockertestenv",
        "//src/internal/migrations",
        "//src/internal/pbutil",
        "//src/internal/pctx",
        "//src/internal/require",
        "//src/internal/storage/fileset",
        "//src/internal/testetcd",
        "//src/pfs",
        "@com_github_google_go_cmp//cmp",
        "@com_github_google_go_cmp//cmp/cmpopts",
        "@com_github_gruntwork_io_terratest//modules/random",
        "@com_github_jmoiron_sqlx//:sqlx",
        "@org_golang_google_protobuf//proto",
        "@org_golang_google_protobuf//types/known/timestamppb",
    ],
)
